package com.sysware.jbrowser;

import com.machinepublishers.jbrowserdriver.JBrowserDriver;
import com.machinepublishers.jbrowserdriver.Settings;
import com.machinepublishers.jbrowserdriver.Timezone;

public class App {

	public static void main(String[] args) {
		JBrowserDriver driver = new JBrowserDriver(Settings.builder().timezone(Timezone.AMERICA_NEWYORK).build());

		// This will block for the page load and any
		// associated AJAX requests
		driver.get("https://www.baidu.com");

		// You can get status code unlike other Selenium drivers.
		// It blocks for AJAX requests and page loads after clicks
		// and keyboard events.
		System.out.println(driver.getStatusCode());

		// Returns the page source in its current state, including
		// any DOM updates that occurred after page load
		System.out.println(driver.getPageSource());
		System.out.println(driver.getSessionId());

		// Close the browser. Allows this thread to terminate.
	}

}
